package com.czy.facecompare.service;

import com.baidu.idl.main.facesdk.FaceFeature;
import com.baidu.idl.main.facesdk.callback.Callback;
import com.baidu.idl.main.facesdk.model.BDFaceImageInstance;
import com.czy.facecompare.ResultState;
import jdk.nashorn.internal.runtime.Context;
import org.springframework.stereotype.Service;

/**
 * 百度AI封装接口
 */

@Service
public interface BaiduAi {

    // 离线注册接口
    void initOffLine(Context context);

    // 新版本模型加载
//    void initModel(final Context context,final String idPhotoModel,final String visModel,final String nirModel,final String rgbdModel, final Callback callback);

    // 图片的质量和遮挡检测
    void initQuality(Context context);

    // 创建百度图片对象
    BDFaceImageInstance createImage(byte[] data, int height, int width);

    // 创建特征提取和人脸对比
    float getFeature(BDFaceImageInstance imageInstance, float[] landmarks, byte[] feature);

    // 有RGBD特征提取
    float getFeatureRGBD(BDFaceImageInstance imageInstance,BDFaceImageInstance imageInstance_depth, float[] landmarks, byte[] feature);

    // 人脸对比
    float featureCompare(byte[] feature1,byte[] feature2,boolean isPercent);

    // 模型卸载
    void uninitModel();

    // 对结果进行状态检测
    ResultState stateCheck(int code);
}
